Skip to content

test(surreal_container): additive seam falsifier — SurrealMailboxView → VersionScheduler → KanbanMove#510

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/sleepy-cori-aRK2x
Jun 16, 2026
Merged

test(surreal_container): additive seam falsifier — SurrealMailboxView → VersionScheduler → KanbanMove#510
AdaWorldAPI merged 1 commit into
mainfrom
claude/sleepy-cori-aRK2x

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jun 16, 2026

Copy link
Copy Markdown
Owner

What

Adds a seam falsifier for the SurrealMailboxView → VersionScheduler::on_version → KanbanMove path — the IN-direction of the surreal↔kanban↔scheduler wiring.

Additive: one new test file, zero source change. It is also the first integration-test file in surreal_container (the crate had none).

Why

The scheduler→kanban→view path (a Lance version tick lowering to the next Rubicon KanbanMove over a MailboxSoaView) existed only as doc-comment prose plus one single-tick in-crate unit test against a hand-rolled FakeView. Nothing asserted the real SurrealMailboxView read-glove across the full Rubicon lifecycle. This puts that seam on a test bench.

Each test is kill-condition-first — it pins the contract the doc-comment claims, not current behaviour (deliberately avoiding the stale-test trap that produced the 3 stale bgz-tensor assertions fixed in #506):

Test Kill-condition (what would prove the seam WRONG)
full_rubicon_arc_lowers_to_legal_successors a forward tick emits an edge the Rubicon DAG doesn't sanction (can_transition_to == false); walks Planning→CognitiveWork→Evaluation→Commit + Plan→Planning
absorbing_columns_schedule_no_move Commit/Prune schedule an advance → a non-terminating lifecycle
libet_anchor_only_on_sigma_commit_crossing the -550_000µs readiness anchor lands anywhere but the Planning→CognitiveWork Σ-commit crossing
lowering_is_deterministic same (view, version, exec) → different move → hidden state leaked in
exec_target_rides_onto_the_move the ExecTarget backend selector is dropped/rewritten during lowering

Scope (deliberate)

IN-direction seam only — contract-space (SurrealMailboxView + NextPhaseScheduler, both reachable without the gated surrealdb cold-build path). This does not touch the contested planner-emit half (the CognitiveCycle sequencer + the §9 LOCKED decisions from #496), which is the planner-owning session's lane. This bench is the template that half can be verified against once it lands.

Verification (local — sandbox has the full lance-7 toolchain)

cargo test -p surreal_container --test scheduler_seam   → 5 passed / 0 failed
cargo fmt  -p surreal_container -- --check              → clean

Note

surreal_container is not in any CI workflow, so — like the crate itself — this test runs locally / on-demand only. Another data point for the standing CI-coverage-gap follow-up (CI tests 4 of ~30 crates; two CI-invisible reds — causal-edge, bgz-tensor — have already been found and fixed this session).


Generated by Claude Code

Summary by CodeRabbit

  • Tests
    • Added comprehensive test coverage for scheduler functionality to verify expected behavior and ensure system reliability.

… → VersionScheduler → KanbanMove

The scheduler→kanban→view path (version tick lowers to the next Rubicon
move over a MailboxSoaView) existed only as doc-comment prose + one
single-tick in-crate unit test against a hand-rolled FakeView. Nothing
asserted the REAL SurrealMailboxView read-glove across the full Rubicon
lifecycle. This adds that bench — additive, zero source change, and the
first integration-test file in this crate.

Five kill-condition-first tests (each pins the CONTRACT the doc-comment
claims, not current behaviour — avoiding the stale-test trap):
- full_rubicon_arc_lowers_to_legal_successors: every forward tick emits a
  DAG-sanctioned edge (can_transition_to); walks Planning→CognitiveWork→
  Evaluation→Commit + Plan→Planning.
- absorbing_columns_schedule_no_move: Commit/Prune yield None (lifecycle
  terminates).
- libet_anchor_only_on_sigma_commit_crossing: -550_000µs stamped only on
  Planning→CognitiveWork; 0 elsewhere.
- lowering_is_deterministic: same (view, version, exec) → same move.
- exec_target_rides_onto_the_move: backend selector survives lowering.

Scope: IN-direction seam only (contract-space; not the gated planner-emit
half per #496 §9). Verified locally: 5/5 pass; fmt clean.
@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

A new test file crates/surreal_container/tests/scheduler_seam.rs is added, containing a view_at helper and five unit tests that verify the NextPhaseScheduler::on_version lowering pipeline: transition arc legality, absorbing-column quiescence, Libet offset placement, determinism, and ExecTarget passthrough.

Changes

Scheduler Seam Falsifier Tests

Layer / File(s) Summary
Test scaffold and transition legality
crates/surreal_container/tests/scheduler_seam.rs
Adds module-level docs, a view_at(phase) helper constructing a minimal SurrealMailboxView, full_rubicon_arc_lowers_to_legal_successors asserting each emitted move is sanctioned by can_transition_to, and absorbing_columns_schedule_no_move asserting on_version returns None for Commit/Prune phases.
Behavioral property tests
crates/surreal_container/tests/scheduler_seam.rs
Adds libet_anchor_only_on_sigma_commit_crossing verifying libet_offset_us is -550_000 only on the Planning→CognitiveWork crossing and 0 for all other non-absorbing sources; lowering_is_deterministic asserting identical inputs produce equal moves; and exec_target_rides_onto_the_move asserting the ExecTarget selector is preserved unchanged in the emitted move.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • AdaWorldAPI/lance-graph#439: Introduced the can_transition_to / absorbing-column contract and KanbanMove.exec: ExecTarget tagging that these seam tests directly exercise and assert against.

Poem

🐇 A rabbit hops through columns five,
From Planning's dawn to where tasks thrive,
No move from Commit — absorbing stays,
Libet fires once through σ-commit haze,
The exec tag rides safe, never dropped,
Determinism locked, no flip-flopped!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding a seam test suite for the SurrealMailboxView → VersionScheduler → KanbanMove integration, matching the file addition and PR objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
crates/surreal_container/tests/scheduler_seam.rs (1)

37-49: ⚡ Quick win

Consider verifying mailbox and witness_chain_position passthrough.

The test verifies that mv.from, mv.to, and the legality of the transition are correct, but does not check that mv.mailbox matches view.mailbox_id() or that mv.witness_chain_position matches view.current_cycle(). According to the scheduler implementation, these fields should be populated from the view.

Since the test suite includes a dedicated test for exec passthrough (lines 117-125), consider adding similar verification for mailbox and witness_chain_position to ensure these fields are correctly wired through the lowering pipeline.

Suggested assertion additions
         assert_eq!(mv.from, *from, "move.from must echo the observed phase");
         assert_eq!(mv.to, *want_to, "{from:?} must lower to {want_to:?}");
+        assert_eq!(mv.mailbox, 7, "move.mailbox must match view.mailbox_id()");
+        assert_eq!(mv.witness_chain_position, 13, "move.witness_chain_position must match view.current_cycle()");
         // The DAG itself must sanction the emitted edge — the falsifier.

Alternatively, extract a dedicated test similar to exec_target_rides_onto_the_move that verifies mailbox and witness_chain_position passthrough across multiple phases.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@crates/surreal_container/tests/scheduler_seam.rs` around lines 37 - 49, The
test loop iterating through arc.iter() verifies that mv.from, mv.to, and
transition legality are correct, but omits assertions for the mailbox and
witness_chain_position fields of the Move returned by on_version. Add assertions
within the loop to verify that mv.mailbox matches view_at(*from).mailbox_id()
and that mv.witness_chain_position matches view_at(*from).current_cycle(),
ensuring these fields are correctly propagated from the view through the
scheduler's lowering pipeline alongside the existing transition assertions.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@crates/surreal_container/tests/scheduler_seam.rs`:
- Around line 37-49: The test loop iterating through arc.iter() verifies that
mv.from, mv.to, and transition legality are correct, but omits assertions for
the mailbox and witness_chain_position fields of the Move returned by
on_version. Add assertions within the loop to verify that mv.mailbox matches
view_at(*from).mailbox_id() and that mv.witness_chain_position matches
view_at(*from).current_cycle(), ensuring these fields are correctly propagated
from the view through the scheduler's lowering pipeline alongside the existing
transition assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 70a8e946-4858-46b5-98cc-294053cf1da8

📥 Commits

Reviewing files that changed from the base of the PR and between f7734ff and 010020d.

📒 Files selected for processing (1)
  • crates/surreal_container/tests/scheduler_seam.rs

@AdaWorldAPI AdaWorldAPI merged commit 0e6452c into main Jun 16, 2026
6 checks passed
AdaWorldAPI pushed a commit that referenced this pull request Jun 16, 2026
PR #510 merged 2026-06-16 16:36 UTC (merge commit 0e6452c) on main —
+125/-0 additive seam falsifier in crates/surreal_container/tests/
scheduler_seam.rs (first integration-test file in surreal_container).

Five kill-condition-first tests pin the IN-direction of the surreal↔
kanban↔scheduler wiring (SurrealMailboxView → NextPhaseScheduler::
on_version → KanbanMove) against the real view (not FakeView):

  1. full_rubicon_arc_lowers_to_legal_successors
  2. absorbing_columns_schedule_no_move
  3. libet_anchor_only_on_sigma_commit_crossing
  4. lowering_is_deterministic
  5. exec_target_rides_onto_the_move

Out of scope (deferred, explicit in PR body): the OUT-direction =
planner-emit KanbanMove (CognitiveCycle sequencer + §9 LOCKED from
#496). D-MBX-A6-P3 remains the next unblock for closing the loop.
This PR proves the downstream half; upstream still hand-rolled.

Retroactive board update (merge landed before the same-commit
hygiene rule could fire). Two files: PR_ARC_INVENTORY (prepend),
LATEST_STATE (dated bullet + table row).

https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx
AdaWorldAPI pushed a commit that referenced this pull request Jun 16, 2026
PR #510 merged 2026-06-16 16:36 UTC (merge commit 0e6452c) on main —
+125/-0 additive seam falsifier in crates/surreal_container/tests/
scheduler_seam.rs (first integration-test file in surreal_container).

Five kill-condition-first tests pin the IN-direction of the surreal↔
kanban↔scheduler wiring (SurrealMailboxView → NextPhaseScheduler::
on_version → KanbanMove) against the real view (not FakeView):

  1. full_rubicon_arc_lowers_to_legal_successors
  2. absorbing_columns_schedule_no_move
  3. libet_anchor_only_on_sigma_commit_crossing
  4. lowering_is_deterministic
  5. exec_target_rides_onto_the_move

Out of scope (deferred, explicit in PR body): the OUT-direction =
planner-emit KanbanMove (CognitiveCycle sequencer + §9 LOCKED from
#496). D-MBX-A6-P3 remains the next unblock for closing the loop.
This PR proves the downstream half; upstream still hand-rolled.

Retroactive board update (merge landed before the same-commit
hygiene rule could fire). Two files: PR_ARC_INVENTORY (prepend),
LATEST_STATE (dated bullet + table row).

https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx
AdaWorldAPI pushed a commit that referenced this pull request Jun 17, 2026
PR #510 merged 2026-06-16 16:36 UTC (merge commit 0e6452c) on main —
+125/-0 additive seam falsifier in crates/surreal_container/tests/
scheduler_seam.rs (first integration-test file in surreal_container).

Five kill-condition-first tests pin the IN-direction of the surreal↔
kanban↔scheduler wiring (SurrealMailboxView → NextPhaseScheduler::
on_version → KanbanMove) against the real view (not FakeView):

  1. full_rubicon_arc_lowers_to_legal_successors
  2. absorbing_columns_schedule_no_move
  3. libet_anchor_only_on_sigma_commit_crossing
  4. lowering_is_deterministic
  5. exec_target_rides_onto_the_move

Out of scope (deferred, explicit in PR body): the OUT-direction =
planner-emit KanbanMove (CognitiveCycle sequencer + §9 LOCKED from
#496). D-MBX-A6-P3 remains the next unblock for closing the loop.
This PR proves the downstream half; upstream still hand-rolled.

Retroactive board update (merge landed before the same-commit
hygiene rule could fire). Two files: PR_ARC_INVENTORY (prepend),
LATEST_STATE (dated bullet + table row).

https://claude.ai/code/session_01Xzyc27Nx3f8WC5KzwfWfjx
AdaWorldAPI added a commit that referenced this pull request Jun 17, 2026
docs(board): retroactive batch hygiene for #510 / #511 / #512 / #513
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants